<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./lib/bootstrap-3.3.5-dist/css/bootstrap.min.css">
    <script src="./lib/bootstrap-3.3.5-dist/js/jquery-1.11.3.js"></script>
    <script src="./lib/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="./css/dengluzhuce.css">

    <!-- <link rel="stylesheet" href="../css/index.css"> -->
    <!-- <link rel="stylesheet" href="../font/iconfont.css"> -->
    <!-- <link rel="stylesheet" href="../css/shouye.css"> -->
    <!-- <script src="../JavaScript/Highcharts-9.3.2/code/highcharts.js"></script> -->
</head>

<body>
    <div id="denglu">
        <div action="" id="myform">
            <p>欢迎登录</p>
            <p><span>账号</span><input type="text" name="" id="username" placeholder="请输入账号" maxlength="6"
                    onkeyup="value=value.replace(/[^\d]/g,'请输入数字') "
                    onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
            </p>
            <div class="xian"></div>
            <p><span>密码</span><input type="password" name="" id="password" placeholder="请输入登录密码"></p>
            <div class="xian"></div>
            <div id="wangji"><input type="checkbox"><span>记住登录密码</span><a href="">忘记密码？</a></div>
            <button id="sub">登录</button>
            <div id="zhuce"><a href="">短信验证码登录</a><span>没有账号？</span><a href="./html/zhuce.html">立即注册</a></div>
        </div>
    </div>
    <div id="motaikuang"></div>
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel"></h4>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
            </div>
        </div>
    </div>
    <script src="./JavaScript/index.js"></script>
    <script src="./JavaScript/data.js"></script>
    <script>
        let userdata = getmyData('administratorData')
        if (userdata == null) {
            setmyData('administratorData', administratorData)
            userdata = getmyData('administratorData')
        }
        $("#sub").click(function () {
            let user = $('#username').val()
            let pwd = $('#password').val()
            if (user != '' && pwd != '') {
                $('#sub').attr('data-toggle', 'modal')
                $('#sub').attr('data-target', '#myModal')
            }
            let zhuangtai = false
            for (let i = 0; i < userdata.length; i++) {
                if (userdata[i].account == user && userdata[i].pwd == pwd) {
                    location.href = './html/kuang.html'
                    let my = []
                    my.push(userdata[i])
                    setmyData('user', my)
                    zhuangtai = true
                    break
                }
            }
            if (!zhuangtai) {
                $("#myModalLabel").text('账号密码错误')
            }
        })
        $('#denglu').css({
            height: $(window).height() + 'px'
        })
        $('#myform').css({
            top: ($(window).height() - $('#myform').height()) / 2 + 'px'
        })
        $('#zhuce span').css({
            left: $("#zhuce").width() - $('#zhuce a:nth-of-type(2)').width() - 20 + 'px'
        })
    </script>
</body>

</html>